package org.dromara.web.domain.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * @TableName template_script
 */
@TableName(value = "template_script")
@Data
public class TemplateScript implements Serializable {
    /**
     *
     */
    @TableId
    private Long id;

    /**
     *
     */
    private String templateName;

    /**
     * 1 shell,2 python
     */
    private Integer templateLanguage;

    /**
     *
     */
    private String templateContent;

    /**
     * 删除标志（0代表存在 1代表删除）
     */
    @TableLogic
    private String delFlag;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TemplateScript other = (TemplateScript) that;
        return (this.getId() == null ? other.getId() == null : this.getId()
            .equals(other.getId())) && (this.getTemplateName() == null ? other.getTemplateName() == null : this.getTemplateName()
            .equals(other.getTemplateName())) && (this.getTemplateLanguage() == null ? other.getTemplateLanguage() == null : this.getTemplateLanguage()
            .equals(other.getTemplateLanguage())) && (this.getTemplateContent() == null ? other.getTemplateContent() == null : this.getTemplateContent()
            .equals(other.getTemplateContent()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTemplateName() == null) ? 0 : getTemplateName().hashCode());
        result = prime * result + ((getTemplateLanguage() == null) ? 0 : getTemplateLanguage().hashCode());
        result = prime * result + ((getTemplateContent() == null) ? 0 : getTemplateContent().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", templateName=").append(templateName);
        sb.append(", templateLanguage=").append(templateLanguage);
        sb.append(", templateContent=").append(templateContent);
        sb.append("]");
        return sb.toString();
    }
}
